package com.wuliu.framework.config;

import org.dromara.sms4j.aliyun.config.AlibabaConfig;
import org.dromara.sms4j.core.config.SupplierFactory;
import org.dromara.sms4j.tencent.config.TencentConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 文档地址：<a href="https://sms4j.com/doc3/interfaceConfig.html">...</a>
 * 短信发送配置
 *
 * @author realue
 * @version 1.0
 * @date 2023-10-09 11:02
 */
@Configuration
public class SmsConfig {

    @Bean
    public void setConfiguration() {
        //阿里短信配置
        AlibabaConfig alibabaConfig = SupplierFactory.getAlibabaConfig();
        alibabaConfig.setAccessKeyId("LTAI5t8mC5FFfuyns4mNsL1T");
        alibabaConfig.setAccessKeySecret("CxkTWiYjmcK5GYiU2AQ61StoaDsmSo");
        alibabaConfig.setSignature("中旅假日");
        alibabaConfig.setTemplateId("SMS_462405416");
        alibabaConfig.setTemplateName("code");
        alibabaConfig.setAction("SendSms");
        alibabaConfig.setVersion("2017-05-25");
        alibabaConfig.setRegionId("cn-hangzhou");
        //腾讯短信配置
        TencentConfig tencentConfig = SupplierFactory.getTencentConfig();
        tencentConfig.setAccessKeyId("your accessKeyId");
        tencentConfig.setAccessKeySecret("your accessKeySecret");
        tencentConfig.setSdkAppId("your sdkAppId");
        tencentConfig.setSignature("短信签名");
        tencentConfig.setTemplateId("your TemplateId");
        tencentConfig.setTerritory("地域信息");
        tencentConfig.setConnTimeout(60);
        tencentConfig.setRequestUrl("sms.tencentcloudapi.com");
        tencentConfig.setAction("SendSms");
        tencentConfig.setVersion("2021-01-11");
    }
}
